﻿using System;

namespace Wisdom.Core
{
    /// <summary>
    /// 描述：运用程序配置器 接口
    /// </summary>
    public interface IApplicationConfigurator : IConfigSourceConfigurator
    { }

    /// <summary>
    /// 运用程序配置器类
    /// </summary>
    public class ApplicationConfigurator : TypeSpecifiedConfigSourceConfigurator, IApplicationConfigurator
    {
        #region Ctor
        /// <summary>
        /// 构造函数：初始化一个 <c>ApplicationConfigurator</c> 类.
        /// </summary>
        /// <param name="context">配置文件上下文.</param>
        /// <param name="appType">运用程序类型.</param>
        public ApplicationConfigurator(IConfigSourceConfigurator context, Type appType)
            : base(context, appType)
        { }
        #endregion

        #region Protected Methods
        /// <summary>
        /// 配置容器
        /// </summary>
        /// <param name="container">配置容器.</param>
        /// <returns>配置容器.</returns>
        protected override CodeConfigSource DoConfigure(CodeConfigSource container)
        {
            container.Application = Type;
            return container;
        }
        #endregion
    }
}